import com.dmotiko.bolacua.*
import com.dmotiko.general.*
import com.dmotiko.util.*
import mx.utils.Delegate;

class MainTextBolacua
extends BaseClip {
	
	private var container:MovieClip;
	
	function MainTextBolacua(){
		super();
		container = DummyFactory.getNextDummy(this);
		BolacuaSite.getApp().setMainTextBolacua(this);
		BolacuaSite.getApp().addEventListener( BolacuaSite.SECTION_CHANGED, Delegate.create(this, sectionChangedListener) );
		
	}
	
	private function sectionChangedListener(){
		refreshContent();
	}
	
	private function refreshContent(){
		var sLink:String;
		switch(BolacuaSite.getApp().getSection()){
			case BolacuaSite.HOME:
			sLink = "newsComponent";
			break;
			
			case BolacuaSite.ALOJAMIENTO:
			sLink = "alojamientoClip";
			
			break;
			
			case BolacuaSite.COMO_LLEGAR:
			sLink = "comoLlegarClip";
			break;
			
			case BolacuaSite.CONTACTO:
			sLink = "contactoClip";
			break;
			
			case BolacuaSite.EVENTOS:
			sLink = "eventoClip";
			break;
			
			case BolacuaSite.INFRAESTRUCTURA:
			sLink = "infraestructuraClip";
			break;
			
			case BolacuaSite.RESTAURANT:
			sLink = "restauranteClip";
			break;
			
			case BolacuaSite.TARIFAS:
			sLink = "tarifasClip";
			break;
		}
		container.attachMovie(sLink, "mcContent", 1);
	}
	
}